<template>
    <div class="aside-div">
        <el-card class="box-card sys-card">
            <div slot="header" class="clearfix">
                <span>系统公告</span>
            </div>
            <div v-if="notice == ''" style="text-align: center;font-style: italic;">暂无信息</div>
            <div v-else>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{notice}}</div>
        </el-card>
    </div>
</template>

<script>
    import {
        isNull
    } from '../util/util'
    export default{
        data() {
            return {
                notice: '',
            }
        },
        created() {
            this.getWebLatestNotice()
        },
        methods: {
            getWebLatestNotice() {
                const _this = this
                const params = {}
                _this.axios.post(_this.$API.ZHIHUAPI.getWebLatestNotice, _this.qs.stringify(params)).then((res) => {
                    res = res.data
                    // console.log(res)
                    if (res.code === 10000) {
                        if (res.hasOwnProperty('data') && Object.keys(res.data).length > 0) {
                            _this.notice = isNull(res.data.notice) ? '' : res.data.notice
                            // console.log(_this.notice)
                        } else {
                            _this.notice = ''
                        }
                    }
                }).catch(() => {})
            },
        }
    }
</script>

<style scoped>
    .mian-aside .sys-card {
        min-height: 13.75rem;
        font-size: 12px;
    }
</style>
